/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidad;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 841756
 */
@Entity
@Table(name = "tblprestamos")
@NamedQueries({
    @NamedQuery(name = "Tblprestamos.findAll", query = "SELECT t FROM Tblprestamos t"),
    @NamedQuery(name = "Tblprestamos.findByConsecutivos", query = "SELECT t FROM Tblprestamos t WHERE t.consecutivos = :consecutivos"),
    @NamedQuery(name = "Tblprestamos.findByIdeEmp", query = "SELECT t FROM Tblprestamos t WHERE t.ideEmp = :ideEmp"),
    @NamedQuery(name = "Tblprestamos.findByNomEmp", query = "SELECT t FROM Tblprestamos t WHERE t.nomEmp = :nomEmp"),
    @NamedQuery(name = "Tblprestamos.findByReferencia", query = "SELECT t FROM Tblprestamos t WHERE t.referencia = :referencia"),
    @NamedQuery(name = "Tblprestamos.findByConceptoPrestamo", query = "SELECT t FROM Tblprestamos t WHERE t.conceptoPrestamo = :conceptoPrestamo"),
    @NamedQuery(name = "Tblprestamos.findByFechaPrestamo", query = "SELECT t FROM Tblprestamos t WHERE t.fechaPrestamo = :fechaPrestamo"),
    @NamedQuery(name = "Tblprestamos.findByMontoInicial", query = "SELECT t FROM Tblprestamos t WHERE t.montoInicial = :montoInicial"),
    @NamedQuery(name = "Tblprestamos.findByPeriodos", query = "SELECT t FROM Tblprestamos t WHERE t.periodos = :periodos"),
    @NamedQuery(name = "Tblprestamos.findByInteres", query = "SELECT t FROM Tblprestamos t WHERE t.interes = :interes"),
    @NamedQuery(name = "Tblprestamos.findByValorCuota", query = "SELECT t FROM Tblprestamos t WHERE t.valorCuota = :valorCuota"),
    @NamedQuery(name = "Tblprestamos.findByValorInteres", query = "SELECT t FROM Tblprestamos t WHERE t.valorInteres = :valorInteres"),
    @NamedQuery(name = "Tblprestamos.findByValorAbono", query = "SELECT t FROM Tblprestamos t WHERE t.valorAbono = :valorAbono"),
    @NamedQuery(name = "Tblprestamos.findBySaldo", query = "SELECT t FROM Tblprestamos t WHERE t.saldo = :saldo"),
    @NamedQuery(name = "Tblprestamos.findByFechaComienzo", query = "SELECT t FROM Tblprestamos t WHERE t.fechaComienzo = :fechaComienzo")})
public class Tblprestamos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "consecutivos")
    private Long consecutivos;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "ide_emp")
    private String ideEmp;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 25)
    @Column(name = "nom_emp")
    private String nomEmp;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 6)
    @Column(name = "referencia")
    private String referencia;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 15)
    @Column(name = "concepto_prestamo")
    private String conceptoPrestamo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha_prestamo")
    @Temporal(TemporalType.DATE)
    private Date fechaPrestamo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "monto_inicial")
    private double montoInicial;
    @Basic(optional = false)
    @NotNull
    @Column(name = "periodos")
    private long periodos;
    @Basic(optional = false)
    @NotNull
    @Column(name = "interes")
    private long interes;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valor_cuota")
    private long valorCuota;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valor_interes")
    private long valorInteres;
    @Basic(optional = false)
    @NotNull
    @Column(name = "valor_abono")
    private long valorAbono;
    @Basic(optional = false)
    @NotNull
    @Column(name = "saldo")
    private long saldo;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecha_comienzo")
    @Temporal(TemporalType.DATE)
    private Date fechaComienzo;
    @JoinColumn(name = "cod_compania", referencedColumnName = "cod_compania")
    @ManyToOne(optional = false)
    private Tblcompania codCompania;
    @JoinColumn(name = "id_estado", referencedColumnName = "id_estado")
    @ManyToOne(optional = false)
    private TblEstado idEstado;

    public Tblprestamos() {
    }

    public Tblprestamos(Long consecutivos) {
        this.consecutivos = consecutivos;
    }

    public Tblprestamos(Long consecutivos, String ideEmp, String nomEmp, String referencia, String conceptoPrestamo, Date fechaPrestamo, double montoInicial, long periodos, long interes, long valorCuota, long valorInteres, long valorAbono, long saldo, Date fechaComienzo) {
        this.consecutivos = consecutivos;
        this.ideEmp = ideEmp;
        this.nomEmp = nomEmp;
        this.referencia = referencia;
        this.conceptoPrestamo = conceptoPrestamo;
        this.fechaPrestamo = fechaPrestamo;
        this.montoInicial = montoInicial;
        this.periodos = periodos;
        this.interes = interes;
        this.valorCuota = valorCuota;
        this.valorInteres = valorInteres;
        this.valorAbono = valorAbono;
        this.saldo = saldo;
        this.fechaComienzo = fechaComienzo;
    }

    public Long getConsecutivos() {
        return consecutivos;
    }

    public void setConsecutivos(Long consecutivos) {
        this.consecutivos = consecutivos;
    }

    public String getIdeEmp() {
        return ideEmp;
    }

    public void setIdeEmp(String ideEmp) {
        this.ideEmp = ideEmp;
    }

    public String getNomEmp() {
        return nomEmp;
    }

    public void setNomEmp(String nomEmp) {
        this.nomEmp = nomEmp;
    }

    public String getReferencia() {
        return referencia;
    }

    public void setReferencia(String referencia) {
        this.referencia = referencia;
    }

    public String getConceptoPrestamo() {
        return conceptoPrestamo;
    }

    public void setConceptoPrestamo(String conceptoPrestamo) {
        this.conceptoPrestamo = conceptoPrestamo;
    }

    public Date getFechaPrestamo() {
        return fechaPrestamo;
    }

    public void setFechaPrestamo(Date fechaPrestamo) {
        this.fechaPrestamo = fechaPrestamo;
    }

    public double getMontoInicial() {
        return montoInicial;
    }

    public void setMontoInicial(double montoInicial) {
        this.montoInicial = montoInicial;
    }

    public long getPeriodos() {
        return periodos;
    }

    public void setPeriodos(long periodos) {
        this.periodos = periodos;
    }

    public long getInteres() {
        return interes;
    }

    public void setInteres(long interes) {
        this.interes = interes;
    }

    public long getValorCuota() {
        return valorCuota;
    }

    public void setValorCuota(long valorCuota) {
        this.valorCuota = valorCuota;
    }

    public long getValorInteres() {
        return valorInteres;
    }

    public void setValorInteres(long valorInteres) {
        this.valorInteres = valorInteres;
    }

    public long getValorAbono() {
        return valorAbono;
    }

    public void setValorAbono(long valorAbono) {
        this.valorAbono = valorAbono;
    }

    public long getSaldo() {
        return saldo;
    }

    public void setSaldo(long saldo) {
        this.saldo = saldo;
    }

    public Date getFechaComienzo() {
        return fechaComienzo;
    }

    public void setFechaComienzo(Date fechaComienzo) {
        this.fechaComienzo = fechaComienzo;
    }

    public Tblcompania getCodCompania() {
        return codCompania;
    }

    public void setCodCompania(Tblcompania codCompania) {
        this.codCompania = codCompania;
    }

    public TblEstado getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(TblEstado idEstado) {
        this.idEstado = idEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (consecutivos != null ? consecutivos.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tblprestamos)) {
            return false;
        }
        Tblprestamos other = (Tblprestamos) object;
        if ((this.consecutivos == null && other.consecutivos != null) || (this.consecutivos != null && !this.consecutivos.equals(other.consecutivos))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + consecutivos + "";
    }
    
}
